import QtQuick 6.2
import QtQuick.Controls 2.15

BusyIndicator {
    id: busyIndicator1
    width: 136
    height: 134
    anchors.verticalCenter: parent.verticalCenter
    activeFocusOnTab: false
    focus: false
    focusPolicy: Qt.NoFocus
    wheelEnabled: true
    running: true
    contentItem: Item {
        implicitWidth: 64
        implicitHeight: 64
        Item {
            id: itemt
            x: parent.width / 2 - 32
            y: parent.height / 2 - 32
            width: 64
            height: 64
            opacity: busyIndicator1.running ? 1 : 0
            Behavior on opacity {
                OpacityAnimator {
                    duration: 250
                }
            }
            RotationAnimator {
                target: itemt
                running: busyIndicator1.visible && busyIndicator1.running
                from: 0
                to: 360
                loops: Animation.Infinite
                duration: 1000
            }
            Repeater {
                id: repeater
                model: 9
                Rectangle {
                    id: delegate
                    x: itemt.width / 2 - width / 2
                    y: itemt.height / 2 - height / 2
                    implicitWidth: 10
                    implicitHeight: 10
                    radius: 5
                    color: "#21be2b"
                    required property int index
                    transform: [
                        Translate {
                            y: -Math.min(itemt.width, itemt.height) * 0.5 + 5
                        },
                        Rotation {
                            angle: delegate.index / repeater.count * 360
                            origin.x: 5
                            origin.y: 5
                        }
                    ]
                }
            }
        }
    }
}
